<template>
  <div class="departmentcard">
    <div class="departmentcard-title">
      <span>部s门：</span>
      <span>{{departmentData.name}}</span>
    </div>
    <div class="departmentcard-message">
      <div>
        <!-- 要判断 -->
        <span>归属：</span>
        <span>{{departmentData.ascription}}</span>
      </div>
      <div>
        <span>负责人：</span>
        <span>{{departmentData.leader ? departmentData.leader : "无" }}</span>
      </div>
      <div>
        <span>人数：</span>
        <span>{{departmentData.members}}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DepartmentCard',
  props:{
    departmentData :Object
  },
   methods:{
    getDate(date) {
    //时间
    let newDate = new Date(date);
    let [year, month, day] = [
      newDate.getFullYear(),
      newDate.getMonth() + 1,
      newDate.getDate(),
    ];
    return `${year}-${month}-${day}`;
    }
  }
}
</script>

<style lang="scss">
  .departmentcard{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
</style>